#include "Log.hpp"
#include "ThreadPool.hpp"
#include <memory>
#include "Task.hpp"
#include <functional>

using namespace LogModule;
using namespace ThreadPoolModule;
int main()
{
    Enable_Console_Log_Strategy();

    // ThreadPool<task_t> *tp = new ThreadPool<task_t>();
    
    // tp->Start();
    // int count = 10;
    // while(count)
    // {
    //     tp->Enqueue(Download);
    //     sleep(1);
    //     count--;
    // }

    // tp->Stop();

    // tp->Join();

    ThreadPool<task_t>::GetInstance();
    int count = 10;
    while(count)
    {
        sleep(1);
        ThreadPool<task_t>::GetInstance()->Enqueue(Download);
        count--;
    }
    ThreadPool<task_t>::GetInstance()->Stop();

    ThreadPool<task_t>::GetInstance()->Join();


    // Enable_Console_Log_Strategy();
    // LOG(LogLevel::DEBUG) << "hello world" << 3.14;
    // LOG(LogLevel::DEBUG) << "hello world" << 3.14;

    //std::unique_ptr<LogStrategy> strategy = std::make_unique<ConsoleLogStrategy>();
    //std::unique_ptr<LogStrategy> strategy = std::make_unique<FileLogStrategy>();
    //strategy->SyncLog("hello log!");
    //logger.EnableConsoleLogStrategy();

    //logger(LogLevel::DEBUG, "main.cc", 10) << "hello world" << " " << 3.14 << " " << 8899 << "aaaa";
    return 0;
}